<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.1">
  <link rel="apple-touch-icon" sizes="180x180" href="/Typescript/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/Typescript/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/Typescript/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/Typescript/images/logo.svg" color="#222">

<link rel="stylesheet" href="/Typescript/css/main.css">


<link rel="stylesheet" href="/Typescript/lib/font-awesome/css/font-awesome.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"yoursite.com","root":"/Typescript/","scheme":"Muse","version":"7.7.2","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="类型保护 定义  类型保护就是一些表达式，他们在编译的时候就能通过类型信息确保某个作用域内变量的类型 类型保护就是通过关键字判断出分支中的类型 主要分为 typeof, instanceof, null保护, 链判断 ?.,可辨识的联合类型, 类型字面量 + 可辨识联合类型, in操作符   typeof  12345678910111213type Type &#x3D; string | number;">
<meta property="og:type" content="article">
<meta property="og:title" content="Typescript&#x2F;类型保护">
<meta property="og:url" content="http://yoursite.com/2020/11/21/Typescript/%E7%B1%BB%E5%9E%8B%E4%BF%9D%E6%8A%A4/index.html">
<meta property="og:site_name" content="Typescript">
<meta property="og:description" content="类型保护 定义  类型保护就是一些表达式，他们在编译的时候就能通过类型信息确保某个作用域内变量的类型 类型保护就是通过关键字判断出分支中的类型 主要分为 typeof, instanceof, null保护, 链判断 ?.,可辨识的联合类型, 类型字面量 + 可辨识联合类型, in操作符   typeof  12345678910111213type Type &#x3D; string | number;">
<meta property="og:locale" content="en_US">
<meta property="article:published_time" content="2020-11-21T03:54:55.891Z">
<meta property="article:modified_time" content="2020-11-21T04:52:26.350Z">
<meta property="article:author" content="HC">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="http://yoursite.com/2020/11/21/Typescript/%E7%B1%BB%E5%9E%8B%E4%BF%9D%E6%8A%A4/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'en'
  };
</script>

  <title>Typescript/类型保护 | Typescript</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="Toggle navigation bar">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <div>
      <a href="/Typescript/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Typescript</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>


<nav class="site-nav">
  
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/Typescript/" rel="section"><i class="fa fa-fw fa-home"></i>Home</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/Typescript/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>Archives</a>

  </li>
  </ul>

</nav>
</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content">
            

  <div class="posts-expand">
      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block " lang="en">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2020/11/21/Typescript/%E7%B1%BB%E5%9E%8B%E4%BF%9D%E6%8A%A4/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/Typescript/images/avatar.gif">
      <meta itemprop="name" content="HC">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Typescript">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Typescript/类型保护
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">Posted on</span>
              

              <time title="Created: 2020-11-21 11:54:55 / Modified: 12:52:26" itemprop="dateCreated datePublished" datetime="2020-11-21T11:54:55+08:00">2020-11-21</time>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h1 id="类型保护"><a href="#类型保护" class="headerlink" title="类型保护"></a>类型保护</h1><ul>
<li><p>定义</p>
<ul>
<li>类型保护就是一些表达式，他们在编译的时候就能通过类型信息确保某个作用域内变量的类型</li>
<li>类型保护就是通过关键字判断出分支中的类型</li>
<li>主要分为 <code>typeof</code>, <code>instanceof</code>, <code>null保护</code>, <code>链判断 ?.</code>,<code>可辨识的联合类型</code>, <code>类型字面量 + 可辨识联合类型</code>, <code>in操作符</code></li>
</ul>
</li>
<li><p>typeof </p>
<figure class="highlight ts"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">type</span> Type = <span class="built_in">string</span> | <span class="built_in">number</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">interface</span> IFunc &#123;</span><br><span class="line">    (name: Type): <span class="built_in">void</span>;</span><br><span class="line">&#125;</span><br><span class="line"><span class="keyword">const</span> fn: IFunc = (name: Type): <span class="function"><span class="params">void</span> =&gt;</span> &#123;</span><br><span class="line">    <span class="keyword">if</span> (<span class="keyword">typeof</span> name === <span class="string">'string'</span>) &#123;</span><br><span class="line">        <span class="comment">// name.就有string类型的方法的代码提示了</span></span><br><span class="line">    &#125; <span class="keyword">else</span> <span class="keyword">if</span> (<span class="keyword">typeof</span> name === <span class="string">'number'</span>) &#123;</span><br><span class="line">        <span class="comment">// name.就有number类型的方法的代码提示了</span></span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line">fn(<span class="string">'name'</span>);</span><br></pre></td></tr></table></figure>
</li>
<li><p>instanceof</p>
<figure class="highlight ts"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">class</span> Person &#123;</span><br><span class="line">    <span class="keyword">public</span> name: <span class="built_in">string</span> = <span class="string">'hchlq'</span>;</span><br><span class="line">&#125;</span><br><span class="line"><span class="keyword">class</span> Animal &#123;</span><br><span class="line">    <span class="keyword">public</span> age: <span class="built_in">number</span> = <span class="number">18</span>;</span><br><span class="line">&#125;</span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">getType</span>(<span class="params">Ctor: Person | Animal</span>):<span class="title">void</span> </span>&#123;</span><br><span class="line">    <span class="keyword">if</span> (Ctor <span class="keyword">instanceof</span> Person) &#123;</span><br><span class="line">        <span class="comment">// Ctor.  就有提示了</span></span><br><span class="line">    &#125; <span class="keyword">else</span> <span class="keyword">if</span> (Ctor <span class="keyword">instanceof</span> Animal) &#123;</span><br><span class="line">        <span class="comment">// Ctor.  就有提示了</span></span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line"><span class="keyword">const</span> person = <span class="keyword">new</span> Person();</span><br><span class="line"><span class="keyword">const</span> animal = <span class="keyword">new</span> Animal();</span><br><span class="line">getType(person);</span><br></pre></td></tr></table></figure>
</li>
<li><p>null 保护</p>
<figure class="highlight ts"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">getName</span>(<span class="params">name: <span class="built_in">string</span> | <span class="literal">null</span></span>):<span class="title">void</span> </span>&#123;</span><br><span class="line">    <span class="keyword">if</span> (name !== <span class="literal">null</span>) &#123;</span><br><span class="line">        <span class="comment">// 可以 name.提示了</span></span><br><span class="line">        <span class="comment">// todo...</span></span><br><span class="line">    &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">        <span class="comment">// todo...ts</span></span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="comment">// 或者用如下方式 </span></span><br><span class="line">    name = name || <span class="string">''</span>;</span><br><span class="line">    <span class="comment">// name.</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p>链判断 <code>?.</code>运算符</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">a?.b;  &#x2F;&#x2F; 表示的是，如果a不存在, 那么返回undefined, 否则返回a.b的是</span><br><span class="line">a?.[x]; &#x2F;&#x2F; 表示的是，如果a不存在，那么返回undefined, 否则返回a[x]的值</span><br><span class="line">a?.b(); &#x2F;&#x2F; 表示的是，如果a不存在，那么返回undefined, 否则返回a.b()的值</span><br><span class="line">a?.(); &#x2F;&#x2F; 表示的是，如果a不存在，那么返回undefined, 否则返回a()的值</span><br></pre></td></tr></table></figure>
</li>
<li><p>可辨识的联合类型</p>
<ul>
<li><p>利用联合类型中的共有字段进行类型保护的一种技巧</p>
</li>
<li><p>相同字段的不同取值就是可辨识</p>
<figure class="highlight ts"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">interface</span> IA &#123;</span><br><span class="line">    name: <span class="string">'hc'</span>,</span><br><span class="line">    dd: <span class="number">19</span></span><br><span class="line">&#125;</span><br><span class="line"><span class="keyword">interface</span> IB &#123;</span><br><span class="line">    name: <span class="string">'hlq'</span>,</span><br><span class="line">    hh: <span class="number">19</span></span><br><span class="line">&#125;</span><br><span class="line"><span class="keyword">type</span> Type = IA | IB;</span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">getType</span>(<span class="params">ctor: Type</span>):<span class="title">void</span> </span>&#123;</span><br><span class="line">    <span class="keyword">if</span> (ctor.name === <span class="string">'hc'</span>) &#123;</span><br><span class="line">        <span class="comment">// ctor. dd | name </span></span><br><span class="line">    &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">        <span class="comment">// ctor. hh | name</span></span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
</ul>
</li>
<li><p>in 判断符</p>
<figure class="highlight ts"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">interface</span> Cat &#123;</span><br><span class="line">    name: <span class="built_in">string</span>;</span><br><span class="line">&#125;</span><br><span class="line"><span class="keyword">interface</span> Dog &#123;</span><br><span class="line">    age: <span class="built_in">number</span>;</span><br><span class="line">&#125;</span><br><span class="line"><span class="keyword">type</span> Type = Cat | Dog;</span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">getType</span>(<span class="params">ctor: Type</span>):<span class="title">void</span> </span>&#123;</span><br><span class="line">    <span class="keyword">if</span> (<span class="string">'name'</span> <span class="keyword">in</span> ctor) &#123;</span><br><span class="line">        <span class="comment">// ctor.</span></span><br><span class="line">    &#125; <span class="keyword">else</span> <span class="keyword">if</span>(<span class="string">'age'</span> <span class="keyword">in</span> ctor) &#123;</span><br><span class="line">        <span class="comment">// ctor.</span></span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p><code>parameterName in Type</code>这种形式，parameterName必须是来自当前函数的一个参数</p>
<figure class="highlight ts"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">interface</span> Cat &#123;</span><br><span class="line">    name: <span class="built_in">string</span>;</span><br><span class="line">&#125;</span><br><span class="line"><span class="keyword">interface</span> Dog &#123;</span><br><span class="line">    age: <span class="built_in">number</span>;</span><br><span class="line">&#125;</span><br><span class="line"><span class="keyword">type</span> Type = Cat | Dog;ts</span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">getType</span>(<span class="params">ctor: Type</span>):<span class="title">ctor</span> <span class="title">is</span> <span class="title">Cat</span> </span>&#123;</span><br><span class="line">    <span class="comment">// return (&lt;Cat&gt;ctor).name === 'hc';</span></span><br><span class="line">    <span class="keyword">return</span> (ctor <span class="keyword">as</span> Cat).name === <span class="string">'hc'</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p>unknown </p>
<ul>
<li><p>unknown是any的安全类型，对unknown类型的值操作前，必须进行某种类型的检查。而在对any类型进行操作前，是没有进行检查的。</p>
</li>
<li><p>unknown类型只能赋给any和unknown类型本身</p>
</li>
<li><p>unknown类型不能.xx, 不能调用, unknown类型只能进行等或不等操作，不能进行其他操作</p>
<figure class="highlight ts"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">let</span> name: unknown = &#123;a: <span class="number">1</span>&#125;;</span><br><span class="line"><span class="keyword">let</span> name1: <span class="built_in">any</span> = name;</span><br><span class="line"><span class="keyword">let</span> name2: unknown = name;</span><br><span class="line"><span class="keyword">let</span> name3: <span class="built_in">string</span> = name; <span class="comment">// 报错</span></span><br><span class="line"><span class="keyword">let</span> name4: <span class="built_in">number</span> = name; <span class="comment">// 报错</span></span><br><span class="line"><span class="keyword">let</span> name5: <span class="built_in">boolean</span> = name; <span class="comment">// 报错</span></span><br><span class="line"><span class="keyword">let</span> name6: symbol = name; <span class="comment">// 报错</span></span><br><span class="line"><span class="keyword">let</span> name7: <span class="literal">null</span> = name; <span class="comment">// 报错</span></span><br><span class="line"><span class="keyword">let</span> name8: <span class="literal">undefined</span> = name; <span class="comment">// 报错</span></span><br><span class="line">name.xx; <span class="comment">// 报错</span></span><br><span class="line">name(); <span class="comment">// 报错</span></span><br></pre></td></tr></table></figure>
</li>
<li><p>联合类型中的unknown类型</p>
<p>在联合类型中, unknown类型会吸收任何类型，这意味着任意类型与unknown类型联合，都是unknown类型</p>
<figure class="highlight ts"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">type</span> T1 = <span class="built_in">number</span> | unknown; <span class="comment">// unknown</span></span><br><span class="line"><span class="keyword">type</span> T2 = <span class="built_in">boolean</span> | unknown; <span class="comment">// unknown</span></span><br><span class="line"><span class="keyword">type</span> T3 = <span class="built_in">string</span> | unknown; <span class="comment">// unknown</span></span><br></pre></td></tr></table></figure>
</li>
<li><p>交叉类型的unknown类型</p>
<p>在交叉类型中，任何类型都可以吸收unknown类型。将任意类型交unknown类型都得到哪个任意类型</p>
<figure class="highlight ts"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">type</span> T1 = <span class="built_in">number</span> &amp; unknown ;<span class="comment">// number</span></span><br><span class="line"><span class="keyword">type</span> T2 = <span class="built_in">boolean</span> &amp; unknown; <span class="comment">// boolean</span></span><br><span class="line"><span class="keyword">type</span> T3 = <span class="built_in">string</span> &amp; unknown ;<span class="comment">// string</span></span><br></pre></td></tr></table></figure>



</li>
</ul>
</li>
</ul>

    </div>

    
    
    

      <footer class="post-footer">

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/Typescript/2020/11/21/Typescript/%E7%B1%BB/" rel="prev" title="Typescript/类">
      <i class="fa fa-chevron-left"></i> Typescript/类
    </a></div>
      <div class="post-nav-item">
    <a href="/Typescript/2020/11/22/Typescript/%E7%B1%BB%E5%9E%8B%E5%8F%98%E6%8D%A2/" rel="next" title="Typescript/类型变换">
      Typescript/类型变换 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  

  </div>


          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          Table of Contents
        </li>
        <li class="sidebar-nav-overview">
          Overview
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#类型保护"><span class="nav-number">1.</span> <span class="nav-text">类型保护</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">HC</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/Typescript/archives/">
        
          <span class="site-state-item-count">12</span>
          <span class="site-state-item-name">posts</span>
        </a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">HC</span>
</div>
  <div class="powered-by">Powered by <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> v4.2.1
  </div>
  <span class="post-meta-divider">|</span>
  <div class="theme-info">Theme – <a href="https://muse.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Muse</a> v7.7.2
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/Typescript/lib/anime.min.js"></script>
  <script src="/Typescript/lib/velocity/velocity.min.js"></script>
  <script src="/Typescript/lib/velocity/velocity.ui.min.js"></script>

<script src="/Typescript/js/utils.js"></script>

<script src="/Typescript/js/motion.js"></script>


<script src="/Typescript/js/schemes/muse.js"></script>


<script src="/Typescript/js/next-boot.js"></script>




  















  

  

</body>
</html>
